home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / gets52.zip / GSSKDEMO.PRG < prev    next >
Text File  |  1993-03-27  |  1KB  |  57 lines

  1. /*
  2.  
  3.    GSSKDEMO.PRG
  4.    ------------
  5.    Steve Kolterman [76320,37]
  6.  
  7.    Test GETSYSSK.PRG.
  8.  
  9.    Exiting from GET...
  10.    1- jumps to GET 3;
  11.    2- sets READ time out to 5 seconds instead of 0.
  12.    3- does nothing.
  13.    4- sets READ time out to 0 seconds instead of 5.
  14.    5- jumps to GET 2.
  15.  
  16.  
  17.  
  18. */
  19.  
  20. #include "getexit.ch"
  21.  
  22. #xcomm READ [<sv: SAVE>] [AT POSITION <pos>] [TIMEOUT <tm>]  =>  ;
  23.        ReadModal( getlist,[<pos>],[<tm>] )  ;
  24.        [; IIF( !<.sv.>, getlist:= {}, ) ]
  25.  
  26. #define GE_JUMP    10
  27. #define ORDPOS     cargo[1]
  28.  
  29.  
  30. FUNCTION Test
  31. LOCAL getlist:= {},nX,aGets[5],nRow:= 5
  32.  
  33. FOR nX:= 1 TO Len(aGets)
  34.    aGets[nX]:= nX
  35.    @ ++nRow,5 GET aGets[nX]
  36.    getlist[nX]:cargo:= {nX}
  37.    IIF( nX==1 .or. nX==5, ;
  38.         getlist[nX]:postblock:= {|g| GetJump(g)}, )
  39.    IIF( nX==2 .or. nX==4, ;
  40.         getlist[nX]:postblock:= {|g| NewTimeOut(g)}, )
  41. NEXT
  42.  
  43. READ AT POSITION 4 TIMEOUT {10,GE_WRITE}
  44.  
  45. RETURN NIL
  46.  
  47. FUNCTION GetJump( oGet )
  48. LOCAL nPos:= IIF( oGet:ORDPOS==1,3,2 )
  49. ReadPos( nPos )
  50. oGet:exitstate:= GE_JUMP
  51. RETURN .T.
  52.  
  53. FUNCTION NewTimeout( oGet )
  54. LOCAL aTime:= IIF(oGet:ORDPOS==2,{5,},{0,})
  55.  ReadTimeOut( aTime )
  56. RETURN .T.
  57.